package com.buaa.utility.services;

import java.util.ResourceBundle;
import javax.servlet.http.HttpServlet;

import com.buaa.utility.Constants;
import com.buaa.utility.util.DBUtil;


public class SystemConfiguration {
	
	public static ResourceBundle dbconfig;

	
	public static void init(HttpServlet servlet){
		if(dbconfig==null){
			dbconfig = ResourceBundle.getBundle("com.buaa.utility.dbconnection");
		}
		
		String key = getSystemProperty(Constants.SYSTEM_CONFIGURATION_KEY);
		String[] keys = key.split(",");
		for(int i=0;i<keys.length;i++){
			DBUtil.getXMLSql(keys[i]);
		}
	}

	public static String getSystemProperty(String key){
		return dbconfig.getString(key);
	}
}
